I have a small question on the DXL script that archives my DOORS database. We have too little space left to hold a number of reasonable copies of the archives, which means that the archiving is failing after about 3 weeks. I have added extra memory to our DOORS server, which now contains another drive on the server (Z: drive). I need to change the script to move the old archives to this drive, but I am struggling what to change in the DXL script, as I don't see a straight renaming command. Can you help? Please see the relevant part in the script below. /*************************************************************************************** renameOldArchives ***************************************************************************************/ void renameOldArchives( string filePath ) {
addToReport( "---Rename old archives---\n") Stat archiveFileStatus const int twoWeeks = 14 * 24 * 60 * 60 Date expiredDate = dateOf( intOf( today ) - twoWeeks ) addToReport( "Expired date is " expiredDate ".\n") // print expiredDate string thisFileName Regexp rTag = regexp "_(OLD|BASE|MONTH)" Regexp rProject = regexp replaceSpace(projectName) for thisFileName in directory filePath do { if (! rProject thisFileName ) { continue } if (thisFileName == "." or thisFileName == ".."){continue} // print thisFileName archiveFileStatus = create filePath thisFileName Date fileModifiedDate = modified( archiveFileStatus ) if ( fileModifiedDate < expiredDate ) { if (! rTag thisFileName ) { int ext = length(thisFileName)-4 string errmsg = renameFile( filePath thisFileName, filePath thisFileName[0:ext-1] "_OLD" thisFileName[ext:length(thisFileName)-1] ) if ( !null(errmsg) ) { addToReport( "Rename archive failed. " errmsg ".\n") } else { addToReport( "Archive file renamed. " thisFileName " renamed " thisFileName[0:ext-1] "_OLD" thisFileName[ext:length(thisFileName)-1] ".\n") } // print " old\n" } } delete archiveFileStatus } AlieHagedoorn - Sat Jul 20 08:13:15 EDT 2013 |
Re: Rename file to another drive it's the renameFile in
|